/**
 * Created by lance on 2017/2/25.
 */

import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { Jsonp, URLSearchParams,Response } from '@angular/http';
import { Observable }   from 'rxjs/observable';
import 'rxjs/add/operator/catch';

@Injectable()
export class UserlistService {
  constructor(private jsonp: Jsonp) {}

  grtinfro () {
    let wikiUrl = 'http://api.pinwu.net/site/member';
    let params = new URLSearchParams();
    params.set('callback', 'JSONP_CALLBACK');
    return this.jsonp
      .get(wikiUrl, { search: params })
      .map((res:Response)=>{
        let result=res.json();
        console.log(result);
        return result;
      });
  }
}
